* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2em;
    font-weight: bold;
}

.game-area {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
}

.main-board {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 10px;
}

#game-board {
    background: #000;
    border: 2px solid #333;
    border-radius: 5px;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 200px;
}

.next-piece, .controls {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
}

.next-piece h3, .controls h3 {
    margin-bottom: 10px;
    text-align: center;
    color: #fff;
}

#next-canvas {
    background: #000;
    border: 1px solid #333;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
}

.control-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.control-item span {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

.game-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.game-btn:active {
    transform: translateY(0);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .game-container {
        padding: 10px;
    }
    
    .game-header h1 {
        font-size: 24px;
    }
    
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    
    .main-board canvas {
        width: 250px;
        height: 500px;
    }
    
    .side-panel {
        width: 100%;
        max-width: 300px;
        margin-top: 20px;
    }
    
    .controls {
        font-size: 14px;
    }
}

/* 触摸设备支持 */
@media (hover: none) and (pointer: coarse) {
    .game-btn {
        min-height: 44px;
        font-size: 16px;
    }
}

/* 防止移动端缩放 */
@media screen and (max-width: 480px) {
    html {
        -webkit-text-size-adjust: none;
        -moz-text-size-adjust: none;
        text-size-adjust: none;
    }
}

.side-panel {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.score-board {
    flex-direction: column;
    gap: 10px;
}